From: Keir Fraser Date: Tue, 25 Sep 2007 14:35:17 +0000 (+0100) Subject: xend: Fix VIF MAC address being lost across localhost migration. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14937^2~23 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=468eb4e36f7a88fb51c19961178063d24b79927d;p=xen.git xend: Fix VIF MAC address being lost across localhost migration. VIF details in /vm/ directory in xenstore get deleted by old domain dying. Signed-off-by: Keir Fraser --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index db85e4eead..cc7a63749d 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -174,7 +174,8 @@ def recreate(info, priv): except XendError: pass # our best shot at 'goto' in python :) - vm = XendDomainInfo(xeninfo, domid, dompath, augment = True, priv = priv) + vm = XendDomainInfo(xeninfo, domid, dompath, augment = True, priv = priv, + vmpath = vmpath) if needs_reinitialising: vm._recreateDom() @@ -321,7 +322,7 @@ class XendDomainInfo: """ def __init__(self, info, domid = None, dompath = None, augment = False, - priv = False, resume = False): + priv = False, resume = False, vmpath = None): """Constructor for a domain @param info: parsed configuration @@ -348,7 +349,20 @@ class XendDomainInfo: #if not self._infoIsSet('uuid'): # self.info['uuid'] = uuid.toString(uuid.create()) - self.vmpath = XS_VMROOT + self.info['uuid'] + # Find a unique /vm// path if not specified. + # This avoids conflict between pre-/post-migrate domains when doing + # localhost relocation. + self.vmpath = vmpath + i = 0 + while self.vmpath == None: + self.vmpath = XS_VMROOT + self.info['uuid'] + '/' + str(i) + try: + if self._readVm("uuid"): + self.vmpath = None + i = i + 1 + except: + pass + self.dompath = dompath self.image = None